package cn.wolfcode.mq.linstener;

import cn.wolfcode.domain.OrderInfo;
import cn.wolfcode.domain.PayLog;
import cn.wolfcode.domain.SeckillProduct;
import cn.wolfcode.mapper.PayLogMapper;
import cn.wolfcode.mq.MQConstant;
import cn.wolfcode.mq.OrderMQResult;
import cn.wolfcode.redis.CommonRedisKey;
import cn.wolfcode.service.IOrderInfoService;
import cn.wolfcode.service.ISeckillProductService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @Author: 普发忠
 * @Date: 2021/11/11/14:17
 */
@Component
@RocketMQMessageListener(
        topic = MQConstant.PAY_ZFB,
        consumerGroup = "pay_zfb-consumer"
)
public class PaysStatusListener implements RocketMQListener<PayLog> {
    @Autowired
    private PayLogMapper payLogMapper;
    @Override
    public void onMessage(PayLog payLog) {
        payLogMapper.updateoutTradeNo(payLog.getTradeNo(),payLog.getOutTradeNo());
    }
}
